import java.util.Stack;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User: lv
 * Date: 2023-03-12
 * Time: 17:23
 */
public class StackDemo {

    public static void main(String[] args) {
        MyStack stack=new MyStack();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        stack.push(5);
        stack.push(6);
        System.out.println(stack.pop());//弹出栈顶元素，并且删除 4
        System.out.println(stack.peek());//获取栈顶元素，不删除 3
        System.out.println(stack.peek());
        boolean flg=stack.isEmpty();
        System.out.println(flg);
////        System.out.println("=========================");
////        System.out.println(stack.isEmpty());
        //System.out.println(stack.search(3));
    }

    public static void main1(String[] args) {
        Stack<Integer> stack=new Stack<>();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        System.out.println(stack.pop());//弹出栈顶元素，并且删除 4
        System.out.println(stack.peek());//获取栈顶元素，不删除 3
        System.out.println(stack.peek());
        boolean flg=stack.empty();
        System.out.println(flg);
        System.out.println("=========================");
        System.out.println(stack.isEmpty());
        System.out.println(stack.search(3));
    }
}
